Skip to content

Do not print accessors for default params in repl #12865

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

romanowski
Copy link
Contributor

@romanowski romanowski commented Jun 17, 2021

fixes #12855

@romanowski romanowski requested a review from smarter June 17, 2021 19:50
@@ -307,6 +308,7 @@ class ReplDriver(settings: Array[String],
.membersBasedOnFlags(required = Method, excluded = Accessor | ParamAccessor | Synthetic | Private)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would have expected the exclusion of Synthetic to be enough to avoid default getters, so I think the real issue is that they're not always marked Synthetic, it looks like currently they're only Synthetic if the method they correspond to is also Synthetic, but it should be unconditional: https://github.com/lampepfl/dotty/blob/af3703bc4c489506afb2461e1f7cea72984ea1a0/compiler/src/dotty/tools/dotc/ast/Desugar.scala#L302

@som-snytt
Copy link
Contributor

Although smarter said Scala 3 needs no power mode, I think this would be a good feature (to retain) for power mode.

@smarter
Copy link
Member

smarter commented Jun 17, 2021

@som-snytt You can always run the repl with -Xprint:typer if you want to know what's going on under the hood :).

@som-snytt
Copy link
Contributor

or for the plain truth just :javap, oh wait --. Let me find the ticket for :asmp.

Copy link
Contributor

@anatoliykmetyuk anatoliykmetyuk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since there hasn't been much activity on this PR and it fixes the user-facing issue reasonably well, I'll merge this PR. We could have a separate issue for the correct setting of the Synthetic flag for getters.

@anatoliykmetyuk anatoliykmetyuk merged commit c69da49 into scala:master Jul 8, 2021
@Kordyjan Kordyjan added this to the 3.0.2 milestone Aug 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

REPL should not show implementation detail of generated default argument helper method
5 participants